import React from 'react';
import { history } from 'umi';
import classNames from 'classnames';
import IconTextBtn from '@/components/IconTextBtn';

interface GoBackProps {
  className?: string;
  goBack?: Function;
}
const GoBack = (props: GoBackProps) => {
  const { className, goBack } = props;
  const onClick = () => {
    goBack ? goBack() : history.goBack();
  };
  return (
    <IconTextBtn
      icon="icon-fanhui"
      text="返回"
      onClick={onClick}
      className={className}
    />
  );
};
export default GoBack;
